﻿if exists (select * from sysobjects where id = object_id(N'pBUGLOGTestCasesAdd') and sysstat & 0xf = 4) drop procedure pBUGLOGTestCasesAdd 
GO

-- Creates a new record in the [dbo].[TestCases] table.
CREATE PROCEDURE pBUGLOGTestCasesAdd
    @p_TestCaseName varchar(25),
    @p_Requirements varchar(250),
    @p_Prerequisite varchar(450),
    @p_ReprSteps text,
    @p_ExpectedResult varchar(250),
    @p_TestResult int,
    @p_userID int,
    @p_taskID int,
    @p_TestCaseID_out int output
AS
BEGIN
    INSERT
    INTO [dbo].[TestCases]
        (
            [TestCaseName],
            [Requirements],
            [Prerequisite],
            [ReprSteps],
            [ExpectedResult],
            [TestResult],
            [userID],
            [taskID]
        )
    VALUES
        (
             @p_TestCaseName,
             @p_Requirements,
             @p_Prerequisite,
             @p_ReprSteps,
             @p_ExpectedResult,
             @p_TestResult,
             @p_userID,
             @p_taskID
        )

    SET @p_TestCaseID_out = SCOPE_IDENTITY()

END

